import router from '@/router';
const  goods={
    state:{
        goodsList:[]
    },
    getters:{

    },
    mutations:{
        ADD_Goods(state,{goodsName,goodsPrice}){
            state.goodsList.unshift({
                goodsId:Math.random().toString(36).slice(2),
                goodsName,
                goodsPrice: goodsPrice/1,
                addTime: Date.now(),
            });
            // console.log(state.goodsList);
            router.push('/goodslist');
        }
    }
}
export default goods;